<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        div{
            width: 600px;
            height: 400px;
            border: 2px solid #000;
            display: flex;
            flex-flow: column;
        }
        ul{
            display: flex;
            height: 80px;
            border-bottom: 2px double #000;
        }
        ul li {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            list-style: none;
            font-size: 20px;
            border-left: 1px solid #000;
            user-select: none;
            cursor: pointer;
            background: #ccc;
        }
        ol{
            /* width: 100%;
            height: 100%; */
            flex: 1;
            position: relative;
            display: flex;
        }
        ol li{
            /* flex: 1; */
            position: absolute;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
            display: flex;
            display: none;
            font-size: 80px;
            font-weight: 900;
        }
        div ul .active{
            background: red;
        }
        div ol .active{
            display: flex;
            background: rgb(174, 239, 9);
        }
    </style>
</head>
<body>
    <div>
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ul>
        <ol>
            <li class="active">一</li>
            <li>二</li>
            <li>三</li>
        </ol>
    </div>
</body>
</html>
<script>
    const ulLi = document.querySelectorAll('ul > li')
    const olLi = document.querySelectorAll('ol > li')

    // console.log(ulLi);

    ulLi.forEach((li,i) => {
        li.addEventListener('click',() => {
            ulLi.forEach(li => {
                li.classList.remove('active')
            })
            li.classList.add('active')

            olLi.forEach(li => {
                li.classList.remove('active')
            })
            olLi[i].classList.add('active')
        })
    })

</script>